package com.qf.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.qf.mapper.DtsUserMapper;
import com.qf.pojo.DtsUser;
import com.qf.vo.DayStatis;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * projectName: shop-manage
 *
 * @author: 元
 * time: 2021/9/13 0013 19:21
 * description:
 */
@Service
public class UserServiceImpl implements UserService{
    @Autowired
    private DtsUserMapper dtsUserMapper;
    @Override
    public Integer userCount() {
        QueryWrapper<DtsUser> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("deleted",0);
        Integer count = dtsUserMapper.selectCount(queryWrapper);
        return count;
    }

    @Override
    public List<DayStatis> recentCount(Integer dayAgo) {
        List<DayStatis> list = dtsUserMapper.statuisIncrCnt(dayAgo);
        return list;
    }

    @Override
    public List<Map> statUserByPage() {
        List<Map> mapList = dtsUserMapper.queryAllUser();
        return mapList;
    }
}
